const http = require('../../util/http')
Page({
  onShareAppMessage() {
    return {
      title: '首页',
      path: 'entry/index/index',
    };
  },
  data: {
    inputValue:'',
    showUser:true,
  },
  bindKeyInput(e) {
    this.setData({
      inputValue: e.detail.value,
    });
  },
  changeLogin(){
    console.log(this.data)
    this.setData({
      showUser:!this.data.showUser
    })
  },
  handleGetUserInfo(e) {
    console.log('handleGetUserInfo', e.detail);
    xhs.showLoading({
      title: '加载中',
    })
    http.post('/api/xhs/saveMember', e.detail.userInfo).then(res => {
      console.log(res)
      xhs.hideLoading()
      if (res.code == 200) {
        xhs.navigateBack({
          delta: 1
        });
      }
    });
  }
});
